import 'package:get/get.dart';

import 'state.dart';

class FindBackSuccessController extends GetxController {
  final state = FindBackSuccessState();

  void timeRun() {
    Future.delayed(const Duration(seconds: 1)).then((value) {
      if (state.downCount <= 1) {
        Get.back();
      } else {
        state.downCount -= 1;
        update();
        timeRun();
      }
    });
  }

  @override
  void onReady() {
    timeRun();
    super.onReady();
  }
}
